package com.aioz.security.controller;


import com.aioz.security.aop.annotation.LogInfoAnnotation;
import com.aioz.security.common.ResponseResult;
import com.aioz.security.service.impl.FollowServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Aioz
 * @since 2022-10-28
 */
@RestController
@RequestMapping("/follow")
public class FollowController {

    @Resource
    private FollowServiceImpl followService;

    @PutMapping("/{companyId}/{isFollow}")
    @LogInfoAnnotation
    public ResponseResult follow(@PathVariable("companyId") Integer companyId,
                                 @PathVariable("isFollow") Boolean isFollow){
        return followService.follow(companyId,isFollow);
    }


    @GetMapping("/or/not/{companyId}")
    @LogInfoAnnotation
    public ResponseResult isFollow(@PathVariable("companyId") Integer companyId){
        return followService.isFollow(companyId);
    }

}
